<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.3.1.css" />
<link rel="stylesheet" type="text/css" href="css/login.css" />
	<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
	<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
<title>Insert title here</title>
<script src="nu.js"></script>
</head>
<body>
	<section id="sportsListPage" data-role="page" data-add-back-btn="true"> 
	<header data-role="header" data-position="fixed">
	<a href="menu.nu" data-role="button" class="ui-btn-right" data-icon="home">Home</a>
	<center><img src="./././img/heart.png" height="50"></center>
	</header>
	<div class="content" data-role="content">
	<c:set var="categoryList" value="${sessionScope.login.list }"></c:set>
		<ul data-role="listview" data-inset="true">
			<c:forEach var="lvo" items="${requestScope.lvo}">
				<li><a href="showPageList.nu?group_type=${lvo.group_type }&group_id=${lvo.group_id }&masterid=${lvo.id }&pageNo=1"><div>
							<table>
								<tr>
									<td width="20%"><center><img src="uploadFile/${lvo.photo }" height="50"/></center></td>
									<td><p><font size="5">${lvo.group_name }</font></p>
										  <p><font size="2" color="#8C8C8C">그룹장 ${lvo.id }님 현재/최대인원(${lvo.group_current}/${lvo.group_max })</font></p>
									</td>
								</tr>
							</table>
						</div>
						</a>
						</li>
						<c:choose>
			<c:when test="${fn:contains(categoryList, 'sports')}"></c:when>
						<c:otherwise>
							<c:if test="${lvo.group_current<=lvo.group_max }">
			 				<li><a href="joinGroup.nu?id=${sessionScope.login.id}&group_type=${lvo.group_type}&group_id=${lvo.group_id}" data-role="button">그룹 가입</a></li>
							</c:if>
						</c:otherwise>
						</c:choose>
			</c:forEach>
		</ul>
	</div>
	<footer data-role="footer" data-position="fixed">
	<div data-role="navbar">
      <ul>
        <c:choose>
		<c:when test="${fn:contains(categoryList, 'sports')}"></c:when>
		<c:otherwise>
        	<li><a data-icon="write" href="showCreateGroup.nu?group_type=sports">그룹 생성</a></li>
        </c:otherwise>
		</c:choose>
        <c:forEach items="${sessionScope.login.list }" var="gvo">
        	<c:choose>
        		<c:when test="${gvo.group_type=='sports'}">
        			<li><a href="showPageList.nu?group_type=${gvo.group_type }&group_id=${gvo.group_id }&pageNo=1" data-icon="search">내 그룹</a></li>
        		</c:when><c:otherwise></c:otherwise>
        	</c:choose>
        </c:forEach>
        <li><a href="" data-icon="search">그룹 검색</a></li>
      </ul>
    </div>
	</footer> </section>
</body>
</html>